#ifndef _ARCH_MMU_H
#define _ARCH_MMU_H

#include <arch/arm.h>

static inline void mmu_enable(void)
{
	set_cr(get_cr() | CR_M);
}

static inline void mmu_disable(void)
{
	set_cr(get_cr() & ~CR_M);
}

static inline void tlbs_invalidate_all(void)
{
	asm("mcr p15, 0, %0, c8, c7, 0"
		: 
		: "r" (0));
}

static inline void itlb_invalidate_all(void)
{
	asm("mcr p15, 0, %0, c8, c5, 0"
		:
		: "r" (0));
}

static inline void dtlb_invalidate_all(void)
{
	asm("mcr p15, 0, %0, c8, c6, 0"
		:
		: "r" (0));
}

#endif /* _ARCH_MMU_H */

